package com.itheima.day02.Demo03;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker extends Thread {
    private final ArrayBlockingQueue<String> list;

    public Cooker(ArrayBlockingQueue<String> list) {
        this.list = list;
    }

    @Override
    public void run() {
        while (true) {
            try {
                list.put("汉堡");
                System.out.println("厨师放一个汉堡");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
